package ThirdQuestion;

/**
 * @author cyt
 * @date 2020/6/9
 */
public class OnlinePackage extends Package implements OnlineService {
    private int netFlow;

    public int getNetFlow() {
        return netFlow;
    }

    public void setNetFlow(int netFlow) {
        this.netFlow = netFlow;
    }

    public OnlinePackage(int feePerMonth, int netFlow){
        super(feePerMonth);
        this.netFlow = netFlow;
    }

    @Override
    public void showAllInfo() {
        System.out.println("本套餐的上网流量为"+netFlow+"M, 每月的资费为"+super.feePerMonth+"元");
    }

    @Override
    public void onlineService(int netFlow, MobileCard mobileCard) {
        System.out.println(mobileCard.getUsername()+"用户"+"本次使用流量为"+getNetFlow()+"M");
    }
}
